package cn.tedu.boot41.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class AxiosController {

    @RequestMapping("/helloAxios")
    @ResponseBody
    public String hello(String info){
        return "服务器接收到了请求!"+info;
    }


    @RequestMapping("/bmi")
    @ResponseBody
    public String bmi(float h,float w){
        float bmi = w/(h * h);
        if (bmi < 18.5) {
            return "过轻";
        }
        if (bmi <= 22.9) {
            return "正常";
        }
        if (bmi <= 24.9) {
            return "偏胖";
        }
        if (bmi <= 29.9) {
            return "肥胖";
        }
        if (bmi <= 40) {
            return "重度肥胖";
        }
        return "极度肥胖";
    }

}
